#ifndef TVREMOTE_H
#define TVREMOTE_H

#include <IRremote/IRremote.h>

enum TVCode : unsigned short {
  POWER = 1,
  TELETEXT,
  HIDDEN_TELETEXT,
  SUBTITLE,
  FREEZE_HOLD,
  SUBPAGE,
  TOP_BOTTOM_FULL,
  BTN_1,
  BTN_2,
  BTN_3,
  BTN_4,
  BTN_5,
  BTN_6,
  BTN_7,
  BTN_8,
  BTN_9,
  FLASHBACK,
  BTN_0,
  INPUT_SOURCE,
  DTV,
  EPG,
  ESG,
  RADIO,
  SOUND_MODE,
  MUTE,
  VOLUME_UP,
  VOLUME_DOWN,
  CHANNEL_UP,
  CHANNEL_DOWN,
  AV_MODE,
  SURROUND,
  DTV_MENU,
  LIST,
  INFO,
  MENU,
  UP,
  DOWN,
  LEFT,
  RIGHT,
  OK,
  BT_END,
  RETURN,
  RED,
  GREEN,
  YELLOW,
  BLUE,
  TRUD,
  SLEEP,
  WIDE_MODES,
  OPC,
  ACTION
};

class TVRemote
{
public:
  void sendCode(TVCode c);

private:
  IRsend irsend;
  long codesValues[51] = {
    0x41A2, //POWER
    0x40B2, //TELETEXT
    0x4072, //HIDDEN_TELETEXT
    0x3FE6, //SUBTITLE
    0x4332, //FREEZE_HOLD
    0x3ECE, //SUBPAGE
    0x43B2, //TOP_BOTTOM_FULL
    0x4202, //1
    0x4102, //2
    0x4302, //3
    0x4082, //4
    0x4282, //5
    0x4182, //6
    0x4382, //7
    0x4042, //8
    0x4242, //9
    0x4392, //FLASHBACK
    0x4142, //0
    0x4322, //INPUT_SOURCE
    0x4416, //DTV
    0x44E9, //EPG
    0x4796, //ESG
    0x4496, //RADIO
    0x4062, //SOUND_MODE
    0x43A2, //MUTE
    0x40A2, //VOLUME_UP
    0x42A2, //VOLUME_DOWN
    0x4222, //CHANNEL_UP
    0x4122, //CHANNEL_DOWN
    0x407E, //AV_MODE
    0x41DA, //SURROUND
    0x4616, //DTV_MENU
    0x4516, //LIST
    0x4362, //INFO
    0x458E, //MENU
    0x43AA, //UP
    0x4012, //DOWN
    0x43AE, //LEFT
    0x406E, //RIGHT
    0x412A, //OK
    0x42BE, //BT_END
    0x409E, //RETURN
    0x404A, //RED
    0x424A, //GREEN
    0x414A, //YELLOW
    0x434A, //BLUE
    0x46EE, //TRUD
    0x4162, //SLEEP
    0x444E, //WIDE_MODES
    0x3F46, //OPC
    0x467E  //ACTION
  };
};

#endif // TVREMOTE_H
